import request from '@/utils/request'

// 微信公众号用户开始---------------------------
export function getWxUsers(params) {
  return request({
    url: '/wechat/wxuser/',
    method: 'GET',
    params
  })
}

export function addWxUser(data) {
  return request({
    url: '/wechat/wxuser/',
    method: 'POST',
    data
  })
}

export function updateWxUser(data) {
  return request({
    url: `/wechat/wxuser/${data.id}/`,
    method: 'PUT',
    data
  })
}

export function delWxUser(id) {
  return request({
    url: `/wechat/wxuser/${id}/`,
    method: 'DELETE',
  })
}

export function delWxUsers(data) {
  return request({
    url: '/wechat/wxuser/batch_delete/',
    method: 'DELETE',
    data
  })
}

export function getUserInfos() {
  return request({
    url: '/wechat/userinfo/',
    method: 'GET',
  })
}
// 微信公众号用户结束----------------------------


// // 微信菜单开始---------------------------
export function getMenu() {
  return request({
    url: '/wechat/menu/',
    method: 'GET',
  })
}


export function createMenu(data) {
  return request({
    url: '/wechat/menu/',
    method: 'POST',
    data,
  })
}

export function deleteMenu(data) {
  return request({
    url: '/wechat/menu/',
    method: 'POST',
    data
  })
}

// // 微信菜单结束----------------------------

// 微信用户角色开始---------------------------
export function getMemberRoles(params) {
  return request({
    url: '/wechat/member_role/',
    method: 'GET',
    params
  })
}

export function addMemberRole(data) {
  return request({
    url: '/wechat/member_role/',
    method: 'POST',
    data
  })
}

export function updateMemberRole(data) {
  return request({
    url: `/wechat/member_role/${data.id}/`,
    method: 'PUT',
    data
  })
}

export function delMemberRole(id) {
  return request({
    url: `/wechat/member_role/${id}/`,
    method: 'DELETE',
  })
}

// 微信用户角色结束----------------------------

// 微信图片轮播开始---------------------------
export function getSwipeImages(params) {
  return request({
    url: '/wechat/swipe_image/',
    method: 'GET',
    params
  })
}

export function addSwipeImage(data) {
  return request({
    url: '/wechat/swipe_image/',
    method: 'POST',
    data
  })
}

export function updateSwipeImage(data) {
  return request({
    url: `/wechat/swipe_image/${data.id}/`,
    method: 'PUT',
    data
  })
}

export function delSwipeImage(id) {
  return request({
    url: `/wechat/swipe_image/${id}/`,
    method: 'DELETE',
  })
}

// export function swipeImageUpload(id) {
//   return request({
//     url: `/wechat/swipe_image/${id}/`,
//     method: 'DELETE',
//   })
// }

// 微信图片轮播结束----------------------------
